<template>
  <view class="myorder">
    <view class="myorder_head">
      <view class="bold">{{ title }}</view>
      <view class="flex" v-if="ismore" @click="nextPage_(nextPage)">
        更多
        <u-icon name="arrow-right" color="#919191" size="13"></u-icon>
      </view>
    </view>
    <view class="myorder_items">
      <template v-if="!islot">
        <view class="myorder_list" v-for="item, indexs in list" :key="indexs" @click="change(item)">
          <view class="flexconter">
            <u-image :src="item.img" mode="aspectFit" height="40rpx" :lazy-load="true" width="40rpx"></u-image>
            <view class="myorder_list_top" v-if="item.value">{{ item.value }}</view>
          </view>
          <view class="ynase">{{ item.name }}</view>
        </view>
      </template>
      <slot v-else></slot>
    </view>
  </view>
</template>
<script setup lang="ts">
export interface Props {
  islot?: boolean,
  list?: any,
  ToPath?: string,
  title?: string,
  ismore?: boolean,
  nextPage?: string
}
const props = withDefaults(defineProps<Props>(), {
  islot: false,
  list: [],
  ToPath: '',
  ismore: true,
  title: '我是标题',
  nextPage: ''
})
const emit = defineEmits({})
function change(Node) {
  emit('change', Node)
  if (Node.path) {
    uni.navigateTo({
      url: Node.path
    })
  }
}
function nextPage_(Node: string) {
  console.log(Node, 'node')
  if (Node) {
    uni.navigateTo({
      url: Node
    })
  }
}
</script>
<style lang="scss" scoped>
@import './index.scss'
</style>